<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="js/browser.js" charset="utf-8"></script>
    <script src="js/react.js" charset="utf-8"></script>
    <script src="js/react-dom.js" charset="utf-8"></script>
    <script type="text/babel">
    class Comp extends React.Component{
      componentWillUnmount(){
        console.log('即将销毁');
      }

      render(){
        return <span>111</span>;
      }
    }

    window.onload=function (){
      var oDiv=document.getElementById('div1');
      var i=0;

      document.onclick=function (){
        i++;
        if(i%2){
          ReactDOM.render(
            <Comp/>,
            oDiv
          );
        }else{
          ReactDOM.render(
            <div>qqqqq</div>,
            oDiv
          );
        }
      };

    };
    </script>
  </head>
  <body>
    <div id="div1">

    </div>
  </body>
</html>
